<div id="wrapper">
	<div id="columns-container">
	    <? foreach ($this->valuationsListFiltered as $valuation): ?>
			<div class="pin car-row-<?= $valuation->id ?>">
				<p style="text-align:right;">
			  	  <button style="float:right;margin-left:2px;" class="btn btn-danger btn-small" onClick="_BROWSE.deleteCar(<?= $valuation->id ?>, 'slide');"><i class="icon-white icon-trash"></i></button>
			 	  <a href="#" style="float:right;margin-left:2px;" class="btn btn-warning btn-small"><i class="icon-white icon-briefcase"></i> &pound;<?= number_format($valuation->getCost(), 0) ?></a>
			 	  <a href="#" style="float:right;" class="btn btn-success btn-small"><i class="icon-white icon-tag"></i> &pound;<?= number_format($valuation->cost_retail, 0) ?></a>
				  <div class="clear"></div>
				  <br><br>
				</p>
				<p>
				  <? if ($valuation->file_name1 && file_exists(CAR_IMG_DIRECTORY.$valuation->file_name1) ): ?>
				    <span class="label label-info">User image</span>
				  <? else: ?>
				    <span class="label label-info">Not actual image</span>
				  <? endif; ?>
				  <img alt="<?= $valuation->manufacturer ?> <?= $valuation->derivative ?>" src="/cars/get-image?file=<?= $valuation->file_name1 ?>&capid=<?= $valuation->CAPID ?>">
				</p>
				<p>
   				  <? /* <?= date("l, j F Y", strtotime($valuation->recorded_stamp)) ?><br> */ ?>
	    		  <strong ><?= $valuation->manufacturer ?></strong>
			      <span class="car-model">
				   <br>
		 		   <strong>Mileage:</strong> <?= number_format($valuation->mileage, 0, " ", " "); ?><br>

			       <?= $valuation->model ?>
			       <?= $valuation->derivative; ?>
			       <?= $valuation->transmission; ?>
			       <?= $valuation->fueltype; ?>
			       <?= $valuation->plate; ?>
			      </span><br>

				  <?= htmlentities(substr($valuation->major_selling_points, 0, 160) ) ?>
				</p>
				<p style="text-align: center;margin-top:10px;">
	    		  <button vID="<?= $valuation->id ?>" class="btn btn-info btn-mini save-car-<?= $valuation->id ?> save-car">Save <i class="icon-white icon-star"></i></button>
				  <a href="/cart/browse?add=<?= $valuation->id ?>" class="btn btn-info btn-mini">Buy now <i class="icon-white icon-download"></i></a>
			  	  <button vID="<?= $valuation->id ?>" class="btn btn-info btn-mini add-to-cart-<?= $valuation->id ?> add-to-cart">Add To Cart <i class="icon-white icon-shopping-cart"></i></button>
				</p>
			</div>
		<? endforeach ?>
	</div>
</div>
<script>
$(window).load(function(){  
  var container = document.querySelector('#columns-container');
  var msnry = new Masonry( container, {
    // options
    columnWidth: 290,
    itemSelector: '.pin'
  });
});
</script>
